﻿<%@ page language="C#" autoeventwireup="true" inherits="Services, MainSite" masterpagefile="~/Site.Master" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="BodyContent">
    <div class="contentfull">
        <div class="breadcrumbs">
            <ul id="crumbs">
                <li><a title="My Account" href="#">My Account</a>
                    <img src="Content/Images/separator.png" alt="&rarr;" class="separator">
                    Services 			</li>
            </ul>
        </div>

        <div id="showMessages">

            <%= GetMessage() %>
        </div>


        <div class="top">
            <div class="innerright">
                <a href="AddService.aspx" class="black_button bhuge" title="Create a Service">Create a Service</a>
                  <div class="need-help"><a href="HowTo/Index.html" target="_blank">Need help creating a Service?</a></div>
            </div>
            <div class="innerleft">
                <h1>Services</h1>
                <div class="lower_comment">
                    Order By:  
                    <a href="Services.aspx?order=time" style="font-weight: lighter; color: #999" id="dateSorter" runat="server">Creation Date</a>
                    <a href="Services.aspx?order=alpha" style="font-weight: lighter; color: #999;" id="nameSorter" runat="server">Name</a>
                    <a href="Services.aspx?order=lastscan" style="font-weight: lighter; color: #999;" id="lastscanSorter" runat="server">Last Scan</a>

                    &nbsp;&nbsp;&nbsp;Show: 
					<a href="Users.aspx?show=all&order=time">All</a>
                </div>

            </div>
            <div class="pagination">
                <div class="scancount large center" id="serviceCount" runat="server"></div>
                <ul id="paginator1"></ul>
            </div>
        </div>
        <div class="content">
            <ul class="data">
                <asp:ListView ID="lstServices" runat="server" ItemPlaceholderID="itemContainer">
                    <LayoutTemplate>
                        <asp:PlaceHolder ID="itemContainer" runat="server"></asp:PlaceHolder>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <li class="group">
                            <p class="data_action">
                                <a href="Scans.aspx?service=<%#Eval("ServiceId")%>" title="View scans made with <%#Eval("ServiceName")%>">View Scans</a>
                                <a href="ServiceType.aspx?ServiceId=<%#Eval("ServiceId")%>">Edit</a>
                                <%-- <a href="#">Duplicate</a>--%>
                                <a href="Services.aspx?mode=delete&serviceid=<%#Eval("ServiceId")%>" class="a_delete_service">Delete</a>
                            </p>

                            <img src="<%#Eval("ImageIconURL")%>" title="<%#Eval("ServiceType")%>" alt="<%#Eval("ServiceType")%>" class="dataicon" />
                            <div class="data_main">
                                <h1><a href="ServiceType.aspx?ServiceId=<%#Eval("ServiceId")%>" title="Edit"><%#Eval("ServiceName")%></a></h1>
                                <h2><%#Eval("ServiceType")%> <em><%#Eval("ServiceDetail")%> </em>
                                </h2>
                            </div>
                            <dl class="meta group">
                                <dt>
                                    <img src="Images/time16.png" class="attr" alt="Date Created"></dt>
                                <dd><%#Eval("CreateDate")%></dd>
                                <dt>
                                    <img src="Images/user16.png" class="attr" alt="Users Authorized For This Service" class="attr" /></dt>
                                <dd><a title="Enable/disable users for this service" href="ServiceType.aspx?ServiceId=<%#Eval("ServiceId")%>"><%#Eval("UserNamesList")%></a></dd>
                                <%# this.GetDBDetail(Eval("ServiceId").ToString())%>
                            </dl>
                        </li>
                    </ItemTemplate>
                    <EmptyDataTemplate>
                        <div>
                            Sorry - No service Found
                        </div>
                    </EmptyDataTemplate>
                </asp:ListView>
            </ul>


            <div class="pagination">
                <ul id="paginator2"></ul>
            </div>
            <script>
                $(document).ready(function () {
                    $(".a_delete_service").click(function (event) {
                        return confirm('You are about to delete both this service and all scans made under this service from our system FOREVER. Are you sure?');
                    });
                });
            </script>
        </div>
    </div>
    <!-- /.contentfull -->

    <!-- /.wrapper -->

</asp:Content>
